package com.hyperboost.mapper;

import com.hyperboost.dto.OpportunityPageQueryDTO;
import com.hyperboost.vo.OpportunityVO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface OpportunityMapper {
    /**
     * 分页条件查询所有机会
     *
     * @param opportunityPageQueryDto
     * @return 分页查结果
     */
    List<OpportunityVO> pageQuery(OpportunityPageQueryDTO opportunityPageQueryDto);

    /**
     * 根据机会ID查询机会详情
     *
     * @param opportunityId
     * @return
     */
    OpportunityVO selectById(Long opportunityId);


    /**
     * 同步更新机会浏览量+1
     *
     * @param opportunityId
     */
    void increaseViewCount(Long opportunityId);

    /**
     * 同步更新机会评论数量+1
     * @param opportunityId
     */
    void increaseCommentCount(Long opportunityId);

    /**
     * 同步更新机会评论数量-?
     *
     * @param opportunityId
     * @param deleteCommentCount
     */
    void decreaseCommentCount(Long opportunityId, int deleteCommentCount);
}
